import request from '@/utils/request'

// 查询关键词列表
export function listKeyWord(query) {
  return request({
    url: '/courseSelect/keyWord/list',
    method: 'get',
    params: query
  })
}

// 查询关键词详细
export function getKeyWord(keyWordId) {
  return request({
    url: '/courseSelect/keyWord/' + keyWordId,
    method: 'get'
  })
}

// 新增关键词
export function addKeyWord(data) {
  return request({
    url: '/courseSelect/keyWord',
    method: 'post',
    data: data
  })
}

// 修改关键词
export function updateKeyWord(data) {
  return request({
    url: '/courseSelect/keyWord',
    method: 'put',
    data: data
  })
}

// 删除关键词
export function delKeyWord(keyWordId) {
  return request({
    url: '/courseSelect/keyWord/' + keyWordId,
    method: 'delete'
  })
}

export function changeKeyWordStatus(keyWordId, status) {
  const data = {
    keyWordId,
    status
  }
  return request({
    url: '/courseSelect/keyWord',
    method: 'put',
    data: data
  })
}
